package com.easylinkin.linkappapi.quality.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.easylinkin.linkappapi.quality.dto.QualityQuestionCommentDto;
import com.easylinkin.linkappapi.quality.entity.QualityQuestionComment;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.List;

/**
 * QualityQuestionComment表数据库访问层
 *
 * @author zhengwen
 * @date 2022/08/16
 */
public interface QualityQuestionCommentMapper extends BaseMapper<QualityQuestionComment> {


    /**
     * 查询分页
     *
     * @param page                      分页参数对象
     * @param appQualityQuestionComment 过滤参数对象
     * @return 查询分页结果
     */
    IPage<QualityQuestionComment> selectPage(Page page, @Param("appQualityQuestionComment") QualityQuestionComment appQualityQuestionComment);

    /**
     * 查询单条
     *
     * @param id 主键id
     * @return 查询结果
     */
    QualityQuestionComment getOneById(@Param("id") Serializable id);

    /**
     * 根据问题id查询评论数量
     *
     * @return 数量
     */
    Integer selectNumByQuestionId(Long questionId);

    /**
     * 根据问题id查询评论
     * @param questionId 问题id
     * @return 评论信息
     */
    List<QualityQuestionCommentDto> getQuestionComment(Long questionId);
}

